import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login"),
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("@/views/home"),
    children: [
      {
        path: "/adv",
        name: "Adv",
        component: () => import("@/views/adv"),
      },
      {
        path: "/category",
        name: "category",
        component: () => import("@/views/category"),
      },
      {
        path: "/categoryupdate",
        name: "categoryupdate",
        component: () => import("@/views/categoryupdate"),
      },
      {
        path: "/cate",
        name: "cate",
        component: () => import("@/views/cate"),
      },
      {
        path: "/shopping",
        name: "shopping",
        component: () => import("@/views/shopping"),
      },
      {
        path: "/collection",
        name: "collection",
        component: () => import("@/views/collection"),
      },
      {
        path: "/flavor",
        name: "flavor",
        component: () => import("@/views/flavor"),
      },
      {
        path: "/order",
        name: "order",
        component: () => import("@/views/order"),
      },
      {
        path: "/ordersall",
        name: "ordersall",
        component: () => import("@/views/ordersall"),
      },
      {
        path: "/ordershipment",
        name: "ordershipment",
        component: () => import("@/views/ordershipment"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
